// 登录时的判断验证
function Show(){}
$.extend(Show.prototype,{
    init:function(){
        this.l_box = $(".l_box")
        this.r_box = $(".r_box")
        this.r_opsition = $(".L_register")
        this.l_opsition = $(".L_login")
        this.opsition   = $(".L_opsition")
        this.input      = $(".resister_item").children()
        //页面上传的有哈希值根据哈希判断应该显示登录还是注册；
        var status = location.hash.substring(1);
        this.show(status);
        //如果是点击错误想更改登录和注册的界面绑点击事件
        this.opsition.on("click",$.proxy(function(evt){
            var e = evt || window.event;
            var target = e.target || e.srcElement;
            status = $(target).hasClass("L_register") ? "r" : "l";
            this.show(status);
        },this))
        //输入框点击要有一个选中的样式
        this.input.on("click",$.proxy(function(evt){
            var e = evt || window.event;
            var target = e.target || e.srcElement;
            $(target).addClass("foucusin");
        },this))
        this.input.on("blur",$.proxy(function(evt){
            var e = evt || window.event;
            var target = e.target || e.srcElement;
            $(target).removeClass("foucusin");
        },this))
        
    },
    show:function(status){
        if(status == "r"){
            this.l_box.css("display","none")
            this.r_box.css("display","block")
            this.r_opsition.addClass("now")
            this.l_opsition.removeClass("now")
        }else{
            this.l_box.css("display","block")
            this.r_box.css("display","none")
            this.r_opsition.removeClass("now")
            this.l_opsition.addClass("now")
        }
    }
})
export default new Show();